import http from "@/utils/request";

const apiPrefix = "/language";


export async function addLanguage(data) {
    return await http.request({
        data: data,
        url: apiPrefix,
        method: 'post'
    })
}

export async function deleteLanguageById(id){
    return await http.request({
        params: {
            id
        },
        url: apiPrefix+'/id',
        method: 'delete'
    })
}

export async function deleteLanguageByIds(ids){
    return await http.request({
        params: {
            ids
        },
        url: apiPrefix+'/batch',
        method: 'delete'
    })
}


export async function searchLanguageById(id){
    return await http.request({
        params: {
            id
        },
        url: apiPrefix+'/id',
        method: 'get'
    })
}

export async function searchLanguage(params){
    return await http.request({
        params: params,
        url: apiPrefix,
        method: 'get'
    })
}

export async function searchLanguageByPage(params){
    return await http.request({
        params: params,
        url: apiPrefix+'/page',
        method: 'get'
    })
}


export async function updateLanguageById(data){
    return await http.request({
        data: data,
        url: apiPrefix,
        method: 'put'
    })
}
